import Api from '@/api/operations/reward'
import i18n from "@/lang/index";
const modalConfig = {
  pageName: 'sys:user',
  dialog: {
    title: i18n.global.t("title.19"),
    width: 800,
    appendToBody: true,
    draggable: true,
    labelWidth: "auto",
  },
  formAction: (data) => {
    console.log('edit', data)
    return new Promise((resolve, reject) => {
      Api.put(data).then((s) => {
        console.log(s)
        resolve(s)
      }).catch((e) => {
        reject(e)
      })
    })
  },
  formItems: [
    {
      type: "input",
      label: "ID",
      prop: "id",
      attrs: {
        disabled: true
      },
    },

    {
      type: "custom",
      label: i18n.global.t("label.18"),
      prop: "reward_type",
      attrs: {
        placeholder: i18n.global.t("hint.69"),
      },
    },
    {
      type: "custom",
      label: i18n.global.t("label.64"),
      prop: "vip_level_id",
      attrs: {
        disabled: true
      },
    },
    {
      type: "input",
      label: i18n.global.t("label.65"),
      prop: "reward_value",
      attrs: {
        placeholder: i18n.global.t("hint.89"),
      }
    },
  ],
  formRules: {
    reward_type: [{ required: true, message: i18n.global.t("hint.69"), trigger: "blur" }],
    vip_level_id: [{ required: true, message: i18n.global.t("hint.104"), trigger: "blur" }],
    reward_value: [{ required: true, message: i18n.global.t("hint.89"), trigger: "blur" }]
  },
}

export default modalConfig
